package gre.english.vocab;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;

public class Word_Activity extends Activity {
	
	TextView word_txtv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_word);
		initialize();
				
		// Receiving the word from the previous activity to find the meaning here
		Bundle gotBasket = getIntent().getExtras();
		String word = gotBasket.getString("key");
		
		// Setting the word as the title of this page
		this.setTitle(word);
		//R.string.title_activity_word
		String meaning = (String)VocabDBHelper.WORDLIST.get(word).get("meaning");
//		WordList_Activity wl = new WordList_Activity();
//		wl.loadWords();
//		word_txtv.setText((String)wl.wordlist.get(word).get("value"));
		word_txtv.setText(meaning);
	}
	
	private void initialize() {
		
		word_txtv = (TextView) findViewById(R.id.txtv_word);
		 
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.word_, menu);
		return true;
	}

}
